package com.edu.javaweb.mapper;

import com.edu.javaweb.pojo.Holiday;
import com.edu.javaweb.pojo.HolidayInformation;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface HolidayInformationMapper {
    @Select("select * from holidayinformation")
    List<HolidayInformation> findAll();
    @Insert("insert into holidayinformation values " +
            "(null,#{holiday},#{beginTime},#{endTime},#{beginRecord},#{endRecord})")
    void insHolidayInformation(HolidayInformation holidayInformation);

    @Update("update holidayinformation set " +
            "holiday=#{holiday}," +
            "begin_time=#{beginTime}," +
            "end_time=#{endTime}," +
            "begin_record=#{beginRecord}," +
            "end_record=#{endRecord}" +
            "where id=#{id}")
    void upHolidayInformation(HolidayInformation holidayInformation);

    @Delete("delete from holidayinformation where id=#{id}")
    void delById(Integer id);

    @Select("select * from holidayinformation where id = #{id}")
    HolidayInformation findById(Integer id);
}
